﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Reflection;
using VisualCron;

public partial class TaskImage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Bitmap FinalBitmap = default(Bitmap);
        string strRenderSource = null;
        MemoryStream msStream = new MemoryStream();

        strRenderSource = Request.Params["TaskName"].ToString();

        // get Task image
        FinalBitmap = new Bitmap(TaskClass.GetTaskImage(strRenderSource));

        FinalBitmap.Save(msStream, ImageFormat.Png);

        Response.Clear();
        Response.ContentType = "image/png";

        msStream.WriteTo(Response.OutputStream);

        if ((FinalBitmap != null))
            FinalBitmap.Dispose();
    }
}